{% extends "base.volt" %}

{% block pageFooter%}
    {{ javascript_include("/assets/manage/js/sys/opAdd.js", false) }}
{% endblock %}

{% block content %}
    {{ partial("module/left_sys") }}
    <div class="col-xs-10">
        <ol class="breadcrumb">
            <li>系统管理</li>
            <li><a href="{{ url.get('sys/opLog') }}">操作员管理</a></li>
            <li class="active">添加操作员</li>
        </ol>
        <form id="form_add" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data" durl="{{ url.get('sys/opList') }}">
            <input type="hidden" name="callback" value="parent.setFormResult" >
            <div class="row form-group">
                <label class="col-xs-2 control-label">账户名</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="operator_account" data-rule="required;remote[get:{{ url.get('sys/opExist') }}]" placeholder="用于登录系统的账号名称">
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">姓名</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="operator_show_name" data-rule="required;" placeholder="登录系统会显示姓名">
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">密码</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="operator_password" data-rule="required; length[6~16]" placeholder="用于登录系统的密码">
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">所属城市</label>
                <div class="col-xs-6">
                    <select class="form-control">
                    	<option value="0">全国</option>
                    	{% for r in opencity %}
                    		<option value="{{r.city_id}}">{{r.city_name}}</option>
                    	{% endfor %}
                    </select>
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">分组</label>
                <div class="col-xs-3">
                    <select class="form-control" name="operator_group" data-rule="required;">
                        {% for og in opGroup %}
                        <option value="{{ og.group_id }}">{{ og.group_name }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
            <div class="row form-group">
                <label class="col-xs-2 control-label">备注</label>
                <div class="col-xs-6">
                    <textarea class="form-control" name="operator_remark" rows="3"></textarea>
                </div>
            </div>
            <div class="form-group">
                <div class="col-xs-offset-2 col-xs-10">
                    <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                </div>
            </div>
        </form>
    </div>
{% endblock %}
